#pragma once

/**
* 本模块定义了设备文件的各种操作事件处理回调函数，是主要的业务实现模块
*/

EXTERN_C_START

//
// The device context performs the same job as
// a WDM device extension in the driver frameworks
//
typedef struct _DEVICE_CONTEXT {
    ULONG readTimeoutMs;   // 读超时时间
    ULONG writeTimeoutMs;  // 写超时时间
    char  demoBuf[256];
} DEVICE_CONTEXT, *PDEVICE_CONTEXT;

//
// This macro will generate an inline function called DeviceGetContext
// which will be used to get a pointer to the device context memory
// in a type safe manner.
//
WDF_DECLARE_CONTEXT_TYPE_WITH_NAME(DEVICE_CONTEXT, DeviceGetContext)

//
// This is the context that can be placed per queue
// and would contain per queue information.
//
typedef struct _QUEUE_CONTEXT {
    ULONG PrivateDeviceData;  // just a placeholder
} QUEUE_CONTEXT, *PQUEUE_CONTEXT;

WDF_DECLARE_CONTEXT_TYPE_WITH_NAME(QUEUE_CONTEXT, QueueGetContext)

//
// Events from the IoQueue object
//
EVT_WDF_IO_QUEUE_IO_DEVICE_CONTROL zyhelloEvtIoDeviceControl;
EVT_WDF_IO_QUEUE_IO_READ           zyhelloEvtIoRead;
EVT_WDF_IO_QUEUE_IO_WRITE          zyhelloEvtIoWrite;
EVT_WDF_IO_QUEUE_IO_STOP           zyhelloEvtIoStop;

EXTERN_C_END
